<?php

namespace App\Console\Commands;

use App\Models\User;
use Illuminate\Console\Command;

class SyncActivedAt extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'bbschat:sync-actived-at';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '将用户最新登录存储在redis中的数据同步到数据表中';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle(User $user)
    {
        $user->syncLastActivedAt();
        $this->info('同步成功');
    }
}
